package pages {
	import flash.events.MouseEvent;
	import flash.display.Sprite;
	import flash.text.TextField;
	import pages.AbstractPage;

	/**
	 * @author martindyrby
	 */
	public class NextPage extends AbstractPage {
		private var textfield : TextField;
		public function NextPage() {
			trace("yeah");
			textfield = new TextField();
			textfield.text = "Next";
			textfield.embedFonts = false;
			addChild(textfield);
			
			var spr:Sprite = new Sprite();
			spr.graphics.beginFill(0x900000);
			spr.graphics.drawCircle(100, 100, 20);
			spr.graphics.endFill();
			spr.addEventListener(MouseEvent.CLICK, clickHandler);
			addChild(spr);
		}
		
		private function clickHandler(event : MouseEvent) : void {
			Sprite(event.target).removeEventListener(MouseEvent.CLICK, clickHandler);
			gotoStartUpPage();
		}
		
		public function gotoStartUpPage() : void {
			dispatchEvent(new NavigationEvent(NavigationEvent.STARTUP));
		}
	}
}
